﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcApplication2.Attributes;
using MvcApplication2.Ultilities.Enums;
using MvcApplication2.ViewModel;

namespace MvcApplication2.Controllers
{
    public class HomeController : BaseController
    {
        [CustomAuthorize]
        public ActionResult Index()
        {
            return View();
        }
        
        [AccessAuthorize(RoleKey.ADMIN)]
        public ActionResult Admin()
        {
            return View();
        }

        public ActionResult Tooltip()
        {
            var viewModel = new TooltipModel
                            {
                                Title = "12345/15",
                                Field1 = "Rosa",
                                Field2 = "Syndicateaaaaaaaaaaaaa"
                            };

            return PartialView("Tooltip", viewModel);
        }

        public ActionResult AjaxSingleTypes(int field1, string field2)
        {
            return Json(new {field1, field2});
        }

        public ActionResult AjaxObjectType(AjaxModel obj1)
        {
            return Json(obj1);
        }

        public ActionResult AjaxObjectTypes(AjaxModel obj1, TooltipModel obj2)
        {
            return Json(true);
        }

        public ActionResult AjaxMixTypes(AjaxModel obj1, string text)
        {
            return Json(true);
        }
    }
}
